<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/pagination.tld" prefix="page"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String areaId = "6";

if(null!=request.getParameter("areaId")){areaId=request.getParameter("areaId");}
if(null!=request.getAttribute("areaId")){areaId=(String)request.getAttribute("areaId");}
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'newGebielinyu_content.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=path %>/reference/css/Beike.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=path %>/reference/js/jquery.js"></script>
	<script type="text/javascript">
	
		function delconection(conid){
			if(window.confirm("确定要删除吗？")){
				window.document.frm.action="<%=path %>/beike/iareaContent.do?method=delAreaContent&conid="+conid+"&month=${month}&week=${week}&targetId=${targetId}&edit=${edit}&areaId=${areaId}";
				window.document.frm.submit();
			}	
		}
		
		//编辑
		function editcontent(tid){
				
				document.getElementById("subbtton").src="<%=path %>/reference/images/button_save.gif";
				document.getElementById("frm").action="<%=path %>/beike/iareaContent.do?method=updateAreaContent&cid="+tid;
				$("#iareaContent").val($("#td"+tid).text());
				
			}
	
	</script>
  </head>
  
  <body>
  	<form action="<%=path %>/beike/iareaContent.do?method=saveAreaContent" name="frm" method="post" id="frm">
  	<input type="hidden" name="month" value="${month }">
  	<input type="hidden" name="week" value="${week }">
  	<input type="hidden" name="targetId" value="${targetId }">
  	<input type="hidden" name="edit" value="${edit }">
  	<input type="hidden" name="areaId" value="${areaId }">
  	
  	<input type="hidden" name="areaId" value="<%=areaId %>">
                    <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#cfe5f5">
				  	<tr>
						<td colspan="4">
							<table width="100%" height="20px;" border="0" cellpadding="3" cellspacing="1" bgcolor="#e6f0f8">
							  <tr>
								<td width="50%"><strong>月单元主题：</strong>${iweekinfo.imonthinfo.monthName }</td>
								<td width="50%"></td>
							  </tr>
							  <tr>
								<td width="50%"><strong>周单元主题：</strong>${iweekinfo.weekThemeName }</td>
								<td width="50%"></td>
							  </tr>
							  <tr>
								<td width="50%"><strong>参考年龄：
								
									<select name="age"  style="width:100px; height:19px;">
										<option value="1" ${'1'==age?'selected':'' }>0-1岁</option>
										<option value="2" ${'2'==age?'selected':'' }>1-2岁</option>
										<option value="3" ${'3'==age?'selected':'' }>2-3岁</option>
										<option value="4" ${'4'==age?'selected':'' }>3-4岁</option>
										<option value="5" ${'5'==age?'selected':'' }>4-5岁</option>
										<option value="6" ${'6'==age?'selected':'' }>5-6岁</option>
										<option value="7" ${'7'==age?'selected':'' }>6-7岁</option>
								  </select>
								 <td width="50%"></td>
							  </tr>
							</table>
						</td>
					</tr>
                    <tr>
                      <td width="6%" height="25" bgcolor="#a4c9ec">序号&nbsp;</td>
                      <td width="66%" height="25" align="center" bgcolor="#a4c9ec"><strong>目标内容</strong></td>
                      <td width="11%" align="center" bgcolor="#a4c9ec"><strong>编 辑</strong></td>
                      <td width="17%" align="center" bgcolor="#a4c9ec"><strong>删 除</strong></td>
					  
                    </tr>
                    <c:forEach items="${contents}" var="con" varStatus="staut">
                    <tr>
                      <td width="6%" height="30" bgcolor="#FFFFFF">${staut.count+(currPage-1)*pageSize }.</td>
                      <td height="30" align="center" bgcolor="#FFFFFF" id="td${con.id }">${con.iareaContent }</td>
                      <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:editcontent(${con.id });"><img src="<%=path %>/reference/images/bianji.gif" alt="" width="16" height="16" border="0"></a></td>
                      <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:delconection(${con.id });"><img src="<%=path %>/reference/images/de.gif" alt="" width="16" height="16" border="0"></a></td>
                    </tr>
                  </c:forEach>
                  </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                      <td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td align="right">
                      	<page:Pagination url="${pageContext.request.contextPath}/beike/iareaContent.do?method=getAreaContent&areaId=<%=areaId %>" currPage="${empty currPage?1:currPage}" pageAmount="${pageAmount}" pageSize="${empty pageSize?10:pageSize}" type="post" form="frm" />
					 		</td></tr></table>
					  </td>
                    </tr>                     
                  </table>      
                  
                  
                   <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                      <td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td width="68%" align="right"><input name="iareaContent" id="iareaContent" type="text" style="width:100%" ></td>
                            <td width="32%"><a href="javascript:frm.submit();"><img src="<%=path %>/reference/images/button_add.gif" id="subbtton" width="44" height="20" border="0"></a></td>
                          </tr>
                      </table></td>
                    </tr>
                </table>
         </form>
  </body>
</html>
